-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ReactNativeOperationHistoryDevtool to track native operations #6612
Add ReactNativeOperationHistoryDevtool to track native operations #6612
Conversation
@gaearon updated the pull request. |
@gaearon updated the pull request. |
Hm. What would you think about just passing the new "props" object instead of How the native "props" get applied is a fast moving implementation detail of each renderer. |
Come to think of it, why isn't props already an argument to |
Yeah, it should be an argument, I just didn’t have a use case yet in ReactPerf. I was shooting for similar output as existing ReactPerf whose To make it useful, we would have to make the devtool aware of the fact that unlike any other native props, Spamming the log is not just bad because it becomes less useful. It is also bad because it makes Indeed, native operations may change any day. This is actually exactly how this devtool is supposed to work. It reports whatever the renderer tells it, the names of everts are not set in stone. When DOM renderer changes to do things in a different way, it is free to fire different native operations in the places where it interfaces with the DOM to give the user a picture of what is going on. |
printWasted could do an deepEqual test. One thing I wanted to try is never diffing native components, not store the previous props, and always override the native ones. Because the DOM calls in modern browsers now have little overhead and is effectively diffed inside the DOM anyway. The bulk of the work has already been done because lack of shouldComponentUpdate bailing out. Basically when I turn that on, any of these assumptions in the tooling would immediately break and I'd have to go fix it. I think there is a false assumption that DOM operations are heavy and therefore we overfocus on this level of the instrumentation. ReactPerf printing these operations is probably an artifact of that. I'll accept for equivalence but I think we should change the heuristic and logged data to something more representative. |
👍 I filed it as #6632 and will come back to it after the old ReactPerf is gone. |
Add ReactNativeOperationHistoryDevtool to track native operations (cherry picked from commit 3bdf09e)
This is extracted from #6046 and implements a new devtool that tracks native operations.